<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateEventReceipt extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasTable('event_receipt')) {
            return;
        }
        Schema::create('event_receipt', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('event_id')->default(0)->comment('事件ID');
            $table->text('description')->comment('描述信息');
            $table->integer('create_time')->nullable();
            $table->integer('update_time')->nullable();
        });
        Schema::create('event_receipt_image', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('event_receipt_id')->default(0)->comment('事件ID');
            $table->string('image')->comment('图片路径');
            $table->integer('create_time')->nullable();
            $table->integer('update_time')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {

    }
}
